package main

import (
	"fmt"
	"time"
)

func main() {
	ch := make(chan string)
	for i := 1; i <= 5000; i++ {
		go printHelloWorld(i, ch) 
	}
	time.Sleep(5 * time.Second)
	for {
		msg := <-ch
		fmt.Println(msg)
	}

}

func printHelloWorld(i int, ch chan string) {
	for {
		ch <- fmt.Sprintf("Hello main %d", i)
	}
	//fmt.Println("Hello world %d", i)
}
